package com.icss.common;

import com.icss.pojo.R;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice()
public class ControllrExceptionHandler {

    @ExceptionHandler({ServiceException.class})
    @ResponseBody
    public R serviceExceptionHandler(Exception e) {

        return R.error(e.getMessage());
    }
}
